<template>
	<!-- #ifdef MP-ALIPAY -->
	<text class="iconfont" :class="type" :style="{color:color,'font-size':fontSize}" ></text>
	<!-- #endif -->
	<!-- #ifndef MP-ALIPAY -->
	<!-- <rich-text class="iconfont"  v-if="type" :style="{color:color,'font-size':fontSize}" :nodes="nodes"></rich-text> -->
	<text class="iconfont" :style="{color:color,'font-size':fontSize}" :class="type" @click="onClick()" ></text>
	<!-- #endif -->
</template>

<script>
	export default {
		props: {
			/**
			 * 图标类型
			 */
			iconfont: String,
			/**
			 * 图标类型
			 */
			type: String,
			/**
			 * 图标颜色
			 */
			color: String,
			/**
			 * 图标大小
			 */
			size: {
				type: [Number, String],
				default: 32
			}
		},
		computed: {
			fontSize() {
				let  size = Number(this.size)
				size = isNaN(size) ? 32 : size * 2
				console.log(size)
				return `${size}rpx`
			},
			nodes(){
				return [{"text":this.type,"type":"text"}]
			}
		},
		methods: {
			onClick() {
				this.$emit('click')
			}
		},
	}
</script>

<style scoped>
@import '@/common/icon.css';
</style>
